import request from '@/config/axios'

export function getClassificationTreeApi(data: GetClassificationTreeRequest) {
	return request.post<ClassificationTreeVo[]>({
		url: '/game/g-classification/readOnly/getClassificationTree',
		data
	})
}

export function saveClassificationApi(data: SaveClassificationRequest) {
	return request.post({
		url: '/game/g-classification/saveClassification',
		data
	})
}

export function getAllBuildingApi() {
	return request.post<GBuilding[]>({
		url: '/game/g-classification/readOnly/getAllBuilding'
	})
}

export function getAllItemApi() {
	return request.post<GItem[]>({
		url: '/game/g-classification/readOnly/getAllItem'
	})
}

export function getAllCreatureApi() {
	return request.post<GCreature[]>({
		url: '/game/g-classification/readOnly/getAllCreature'
	})
}

export function getAllProductApi() {
	return request.post<GProduct[]>({
		url: '/game/g-classification/readOnly/getAllProduct'
	})
}

export function getAllBlueprintApi() {
	return request.post<GBlueprint[]>({
		url: '/game/g-classification/readOnly/getAllBlueprint'
	})
}

export function saveClassificationBuildingApi(data: SaveClassificationBuildingRequest) {
	return request.post<string>({
		url: '/game/g-classification/saveClassificationBuilding',
		data
	})
}

export function saveClassificationItemApi(data: SaveClassificationItemRequest) {
	return request.post<string>({
		url: '/game/g-classification/saveClassificationItem',
		data
	})
}

export function saveClassificationCreatureApi(data: SaveClassificationCreatureRequest) {
	return request.post<string>({
		url: '/game/g-classification/saveClassificationCreature',
		data
	})
}

export function saveClassificationProductApi(data: SaveClassificationProductRequest) {
	return request.post<string>({
		url: '/game/g-classification/saveClassificationProduct',
		data
	})
}

export function saveClassificationBlueprintApi(data: SaveClassificationBlueprintRequest) {
	return request.post<string>({
		url: '/game/g-classification/saveClassificationBlueprint',
		data
	})
}

export function getAllBuildingByClassIdApi(classId: number) {
	return request.get({
		url: '/game/g-classification/readOnly/getAllBuildingByClassId/' + classId
	})
}

export function getAllItemByClassIdApi(classId: number) {
	return request.get({
		url: '/game/g-classification/readOnly/getAllItemByClassId/' + classId
	})
}

export function getAllCreatureByClassIdApi(classId: number) {
	return request.get({
		url: '/game/g-classification/readOnly/getAllCreatureByClassId/' + classId
	})
}

export function getAllProductByClassIdApi(classId: number) {
	return request.get({
		url: '/game/g-classification/readOnly/getAllProductByClassId/' + classId
	})
}

export function getAllBlueprintByClassIdApi(classId: number) {
	return request.get({
		url: '/game/g-classification/readOnly/getAllBlueprintByClassId/' + classId
	})
}
